package com.webservice.client;

import com.webservice.serivce.HelloWorld;
import org.apache.cxf.jaxws.JaxWsClientFactoryBean;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

public class HelloWorldClient {
    public static void main(String[] args) {
        JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
        jaxWsProxyFactoryBean.setAddress("http://127.0.0.1:9001/HelloWorldServer");
        jaxWsProxyFactoryBean.setServiceClass(HelloWorld.class);
        HelloWorld helloWorld = (HelloWorld)jaxWsProxyFactoryBean.create();
        String str = helloWorld.sayHello("张三", 22);
        System.out.println(str);
    }
}
